//
//  UILabel+Helper.h
//  LZLife
//
//  Created by LZ on 2021/3/16.
//

#import <UIKit/UIKit.h>

@interface TextModel : NSObject

@property (nonatomic, copy) NSString *str;

@property (nonatomic, assign) NSRange range;

@end

@interface UILabel (Helper)

- (NSMutableAttributedString *)setupAttributeString:(NSString *)text rangeText:(NSString *)rangeText textColor:(UIColor *)color font:(UIFont *)font;

- (NSAttributedString *)setupAttributeString:(NSString *)text andFont:(UIFont *)font andColor:(UIColor *)textColor andTextAlignment:(NSTextAlignment)textAlignment rangeLineHeight:(float)lineHeight;

- (NSMutableAttributedString *)setupAttributeString:(NSString *)qsbossImageName andTitle:(NSString *)titleStr;

- (NSAttributedString *)setupAttributeString:(NSString *)text andFont:(UIFont *)font andColor:(UIColor *)textColor  rangeText:(NSString *)rangeText rangeTextColor:(UIColor *)rangeTextColor rangeFont:(UIFont *)rangeFont andTextAlignment:(NSTextAlignment)textAlignment rangeLineHeight:(float)lineHeight;


/**
 给文本添加点击事件（使用字符串标记）

 @param strings 需要添加点击事件的字符串数组
 @param tapClick 点击的回调block
 */
- (void)addAttributeActionWithStrings:(NSArray *)strings
                              tapTargetAction:(void (^) (NSString *string ,
                                        NSRange range ,
                                       NSInteger index))tapClick;

/**
 给文本添加点击事件（使用范围标记）

 @param tapRange 需要添加点击事件的范围数组
 @param tapClick 点击的回调block
 */
- (void)addAttributeActionWithRange:(NSArray*)tapRange
                         tapTargetAction:(void (^)
                                          (NSString *string , NSRange range , NSInteger index))tapClick;



@end

